﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaffEditPage.aspx.cs" Inherits="EvaluationSystem.ConfigurationPages.StaffEditPage1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <script type="text/javascript">
         var getTasks = function (tree) {
             var msg = [],
                selNodes = tree.getChecked();
             Ext.each(selNodes, function (node) {
                 if (msg.length > 0) {
                     msg.push(";");
                 }

                 msg.push(node.text);
             });

             return msg.join("");
         };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
     <ext:ToolTip ID="tooltipForRole" 
            runat="server" 
            Target="cbbRole" 
            Html="<div>nothing...</div>" 
            Title="角色内容" 
            AutoHide="false" 
            Closable="true"
            Draggable="true"
             Shadow="Sides"
            />
    <ext:Window 
            ID="StaffAddingWindow" 
            runat="server" 
            Closable="false"
            Resizable="false"
            Height="200" 
            Icon="Lock" 
            Title="增加员工"
            Draggable="false"
            Width="350"
            Modal="false"
            BodyPadding="5"
            Padding="5"
            Layout="AnchorLayout" >
            <Items >
                <ext:TextField 
                    ID="txtUsername" 
                    runat="server"                     
                    FieldLabel="用户名" 
                    AllowBlank="false"
                    BlankText="请输入用户名."
                    Text=""
                    AnchorHorizontal="100%"
                    />
                <ext:TextField 
                    ID="txtPassword" 
                    runat="server" 
                    InputType="Password" 
                    FieldLabel="密码" 
                    AllowBlank="true" 
                   
                    Text=""
                    AnchorHorizontal="100%"
                    TabTip=""
                    />
                    <ext:ComboBox runat="server" ID="cbbRole" AllowBlank="false"  FieldLabel="角色" AnchorHorizontal="100%"/>
                    <ext:DropDownField ID="ddfGroup" runat="server" AnchorHorizontal="100%" TriggerIcon="SimpleArrowDown" FieldLabel="组" AllowBlank="false" BlankText="请选择组.">
            <Component>
                <ext:TreePanel ID="tpGroup" 
                    runat="server" 
                    Title="组"
                    Icon="Accept"
                    Height="300"
                    Shadow="None"
                    UseArrows="true"
                    AutoScroll="true"
                    Animate="true"
                    EnableDD="true"
                    ContainerScroll="true"
                    RootVisible="false">
                    
                    <Buttons>
                        <ext:Button ID="Button1" runat="server" Text="Close">
                            <Listeners>
                                <Click Handler="#{ddfGroup}.collapse();" />
                            </Listeners>
                        </ext:Button>
                    </Buttons>
                    
                    <Listeners>
                        <CheckChange Handler="this.dropDownField.setValue(getTasks(this), false);" />
                    </Listeners>
                          
                 </ext:TreePanel>
            </Component>
            <Listeners>
                <Expand Handler="this.component.getRootNode().expand(true);" Single="true" Delay="10" />
            </Listeners>
        </ext:DropDownField>
                   <%-- <ext:ComboBox runat="server" ID="cbbGroup" AllowBlank="false" FieldLabel="组" AnchorHorizontal="100%"/>--%>
            </Items>
            <Buttons>
                <ext:Button ID="btnSave" runat="server" Text="保存" Icon="Accept">
                    <Listeners>
                        <Click Handler="
                            if (!#{txtUsername}.validate() || !#{ddfGroup}.validate()) {
                                Ext.Msg.alert('Error','请填写必要内容.');
                                // return false to prevent the btnLogin_Click Ajax Click event from firing.
                                return false; 
                            }" />
                    </Listeners>
                    <DirectEvents>
                        <Click OnEvent="btnSave_Click">
                            <EventMask ShowMask="true" Msg="保存中..." MinDelay="500" />
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:Button ID="btnCancel" runat="server" Text="Cancel" Icon="Decline">
                    <Listeners>
                    <Click Handler="parent.Ext.getCmp('EditStaffWindow').close();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:Window>
    </form>
</body>
</html>
